﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Tayninh2011
{
    public sealed partial class FrmTnToolCash : RootForm
    {
        private static readonly FrmTnToolCash meForm = new FrmTnToolCash();
        private FrmTnToolCash()
        {
            InitializeComponent();
        }
        #region singleton

        public static FrmTnToolCash CallMe
        {
            get { return meForm; }
        }

        public new void Show()
        {
            if (isShown)
            {
                
                base.Show();
            }
            else
            {
                base.Show();
                
                isShown = true;
            }
        }
        private static bool isShown = false;

        static FrmTnToolCash()
        {

            meForm.FormClosing += new FormClosingEventHandler(frm_FormClosing);

        }
        private static void frm_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            isShown = false;
            meForm.Hide();
        }

        #endregion singleton
    }
}
